//
//  NetWorkingTools.swift
//  nimabi
//
//  Created by danny on 15/6/26.
//  Copyright © 2015年 DannyLiu. All rights reserved.
//

import UIKit
import AFNetworking

class NetWorkingTools: AFHTTPSessionManager {

    
    private static let instance: NetWorkingTools = {
        
        // 添加baseUrl
        let baseUrlstr = "https://api.weibo.com/"
        let baseUrl = NSURL(string: baseUrlstr)
        
        let tool = NetWorkingTools(baseURL: baseUrl)
    
        // 设置默认的反序列化的格式
        tool.responseSerializer.acceptableContentTypes = NSSet(objects: "application/json", "text/json", "text/javascript", "text/plain") as! Set<String>
        
        return tool
    }()
    
    
    
    
    ///  全局的访问方法
    class func sharedNetWorkingTools() -> NetWorkingTools {
        return instance
    }
    
}
